package vista;


import java.awt.*;
import modelo.Clave;

import javax.swing.*;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.KeyAdapter;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.LineBorder;
import javax.swing.SwingUtilities;
import java.awt.*;
/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
 * @param <JPanelConFondo>
*/
public class VistaClaveAdmin extends javax.swing.JFrame {

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}


	private JPanel jPanel1;
	private JButton jButton1;
	private JPasswordField Txtpass;
	private JTextArea jTextArea2;
	private JTextArea jTextArea1;
	private JTextField txtlog;
    private Clave acc = new Clave();

	public VistaClaveAdmin() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			this.setTitle("Acceso al Sistema");
			{
				jPanel1 = new JPanel();
				getContentPane().add(jPanel1);
				jPanel1.setBounds(32, 20, 239, 207);
				jPanel1.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
				jPanel1.setOpaque(false);
				jPanel1.setLayout(null);
				jPanel1.setBackground(new java.awt.Color(255,255,255));
				}
				{
					txtlog = new JTextField();
					jPanel1.add(txtlog);
					txtlog.setBounds(43, 45, 138, 23);
					txtlog.addFocusListener(new FocusAdapter() {
					});
				}
				{
					jTextArea1 = new JTextArea();
					jPanel1.add(jTextArea1);
					jTextArea1.setText("Login");
					jTextArea1.setBounds(81, 2, 60, 31);
					jTextArea1.setOpaque(false);
					jTextArea1.setFont(new java.awt.Font("Purisa",1,16));
					jTextArea1.setEditable(false);
				}
				{
					jTextArea2 = new JTextArea();
					jPanel1.add(jTextArea2);
					jTextArea2.setText("Password");
					jTextArea2.setOpaque(false);
					jTextArea2.setBounds(63, 80, 90, 27);
					jTextArea2.setFont(new java.awt.Font("Purisa",1,16));
					jTextArea2.setEditable(false);
				}
				{
					jButton1 = new JButton();
					jPanel1.add(jButton1);
					jButton1.setText("Aceptar");
					jButton1.setBounds(69, 169, 102, 25);
					jButton1.setFocusCycleRoot(true);
					jButton1.setFont(new java.awt.Font("Dialog",1,12));
					jButton1.addKeyListener(new KeyAdapter() {
					});
				}
				{
					Txtpass = new JPasswordField();
					txtlog.setNextFocusableComponent(Txtpass);
					jPanel1.add(Txtpass);
					Txtpass.setBounds(43, 128, 138, 23);
					Txtpass.setNextFocusableComponent(jButton1);
			}
			pack();
			this.setSize(318, 287);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
	
	public void addlistener(ActionListener actionListener)
	{
	 this.jButton1.addActionListener(actionListener); 
	}
	
	public void settxtlog(String str){
		txtlog.setText(str);
	}
	
	public JTextField gettxtlog() {
		return txtlog;
	}
	public void settxtpass(String str){
		Txtpass.setText(str);
	}
	
	public JTextField gettxtpass() {
		return Txtpass;
	}	
	
	public void mostrarMensaje(String mensaje) {
		JOptionPane.showMessageDialog(this, mensaje);
	}
}

